import request from "@/util/request.js";

export function reqCreateBorrowRecord(data) {
    return request({
        url: '/borrow-record',
        method: 'post',
        data
    })
}
export function reqBorrowBook(data) {
    return request({
        url: '/borrow-record/borrow',
        method: 'post',
        data
    })
}

export function reqGetBorrowRecordPage(params) {
    return request({
        url: '/borrow-record/page',
        method: 'get',
        params
    })
}

export function reqUpdateBorrowRecord(data) {
    return request({
        url: '/borrow-record/',
        method: 'put',
        data
    })
}
export function reqReturnBook(data) {
    return request({
        url: '/borrow-record/return',
        method: 'put',
        data
    })
}
export function reqGetBorrowRecordStaticByTimeRange(range) {
    return request({
        url: '/borrow-record/statistic',
        method: 'get',
        params: {
            range
        }
    })
}
export function reqGetReadingStar(){
    return request({
        url: '/borrow-record/reading-star',
        method: 'get',
    })
}
export function reqRenewBook(data) {
    return request({
        url: '/borrow-record/renew',
        method: 'post',
        data
    })
}
